<template>
  <view class="index-page">
    <mainMap></mainMap>
    <view class="content">
      <button class="emerg-btn" @click="toEdit()">发起呼救</button>
    </view>
  </view>
</template>

<script setup lang="ts">
import { reactive } from 'vue'

import mainMap from './components/mainMap.vue'

const toEdit = () => {
  uni.navigateTo({
    url: '/pages/call/components/editInfo' // 这里是你要跳转的页面路径
  })
}
</script>

<style scoped>
.index-page {
  width: 100%;
  height: 90vh;
  font-style: normal;
  text-align: center;
}
.h2 {
  color: green;
  font-size: 50rpx;
}
navigator {
  color: #1e80ff;
}

.content {
  width: 100%;
  position: absolute;
  bottom: 20%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.emerg-btn {
  width: 40%;
  height: 100rpx;
  font-size: 24rpx;
  color: #ffffff;
  background-color: #ff4500;
  border: none;
  border-radius: 60rpx;
  position: relative;
  overflow: hidden;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: pulse 2s ease infinite;
}

.emerg-btn::before {
  content: '';
  display: block;
  position: absolute;
  width: 200%;
  height: 200%;
  top: -50%;
  left: -50%;
  background: rgba(255, 69, 0, 0.5);
  background: radial-gradient(
    circle at center,
    rgba(255, 69, 0, 0.5) 0%,
    transparent 70%
  );
  border-radius: 50%;
  z-index: 1;
  animation: ripple 1s ease infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes ripple {
  0% {
    transform: scale(0.8);
    opacity: 1;
  }
  100% {
    transform: scale(2.5);
    opacity: 0;
  }
}
.emerg-btn {
  width: 40%;
  height: 90rpx;
  font-size: 48rpx;
  font-weight: bold;
  color: #ffffff;
  background-color: #ff0000;
  border: none;
  border-radius: 60rpx;
  box-shadow: 0 0 25rpx #ff0000;
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: pulse 1s ease infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 5rpx #ff0000;
    background-color: #ff0000;
  }
  50% {
    box-shadow: 0 0 20rpx #ff4040, 0 0 30rpx #ff4040, 0 0 40rpx #ff4040;
    background-color: #ff4040;
  }
  100% {
    box-shadow: 0 0 5rpx #ff0000;
    background-color: #ff0000;
  }
}
</style>
